package cn.adelyn.base.snowflake.feign;

import cn.adelyn.base.api.snowfalke.feign.SnowflakeFeignClient;
import cn.adelyn.base.snowflake.config.SnowflakeIdUtil;
import cn.adelyn.common.core.response.ServerResponseEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chengze
 * @date 2022/9/16
 * @desc 唯一Id
 */
@RestController
public class SnowflakeFeignController implements SnowflakeFeignClient {

    @Autowired
    SnowflakeIdUtil snowflakeIdUtil;

    @Override
    public ServerResponseEntity<Long> snowflakeId(){
        return ServerResponseEntity.success(snowflakeIdUtil.genSnowflakeId());
    }
}
